package com.collect.zambia.zhiBean.zhiReceive;

import android.text.TextUtils;

import com.collect.zambia.zhiUtils.StringUtil;

import java.io.Serializable;
import java.math.BigDecimal;

public class ZHIRGroupUserPerformanceMergeEntity implements Serializable {
    private String totalNum;
    private String loginName;
    private String groupId;
    private String leven;
    private String sysUserId;
    private String settledRate;
    private String todaySettledNum;

    private String startDate;
    private String endDate;

    public String getTotalNum() {
        return StringUtil.safeString(totalNum);
    }

    public void setTotalNum(String totalNum) {
        this.totalNum = totalNum;
    }

    public int getTotalNumFormat() {
        return StringUtil.numberTothousandFormatterInt(getTotalNum());
    }

    public BigDecimal getTotalNumBigDecimal() {
        String tempString = getTotalNum();
        if (TextUtils.isEmpty(tempString)) {
            tempString = "0";
        }
        BigDecimal bigDecimal = new BigDecimal(tempString).stripTrailingZeros();
        return bigDecimal;
    }

    public String getLoginName() {
        return StringUtil.safeString(loginName);
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getGroupId() {
        return StringUtil.safeString(groupId);
    }

    public void setGroupId(String groupId) {
        this.groupId = groupId;
    }

    public String getLeven() {
        return StringUtil.safeString(leven);
    }

    public String getLevenDisplayFormat() {
        return getLeven().contains("B+") ? "B3+" : getLeven();
    }

    public void setLeven(String leven) {
        this.leven = leven;
    }

    public String getSysUserId() {
        return StringUtil.safeString(sysUserId);
    }

    public void setSysUserId(String sysUserId) {
        this.sysUserId = sysUserId;
    }

    public String getSettledRate() {
        return StringUtil.safeString(settledRate);
    }

    public void setSettledRate(String settledRate) {
        this.settledRate = settledRate;
    }

    public String getSettledRateFormat() {
        return StringUtil.numberFormatterThousandPercent(getSettledRate());
    }

    public float getSettledRateFloat() {
        return StringUtil.numberTothousandFormatterFloat(getSettledRate());
    }

    public BigDecimal getSettledRateBigDecimal() {
        String tempString = getTotalNum();
        if (TextUtils.isEmpty(tempString)) {
            tempString = "0";
        }
        BigDecimal bigDecimal = new BigDecimal(tempString).stripTrailingZeros();
        return bigDecimal;
    }

    public String getTodaySettledNum() {
        return StringUtil.safeString(todaySettledNum);
    }

    public void setTodaySettledNum(String todaySettledNum) {
        this.todaySettledNum = todaySettledNum;
    }

    public int getTodaySettledNumFormat() {
        return StringUtil.numberTothousandFormatterInt(getTodaySettledNum());
    }

    public String getStartDate() {
        return StringUtil.safeString(startDate);
    }

    public void setStartDate(String startDate) {
        this.startDate = startDate;
    }

    public String getEndDate() {
        return StringUtil.safeString(endDate);
    }

    public void setEndDate(String endDate) {
        this.endDate = endDate;
    }

    public String getStartDateMonthDayFormat() {
        String tempStr = StringUtil.safeString(startDate);
        if (tempStr.length() >= 10) {
            tempStr = tempStr.substring(6);
        }
        return tempStr;
    }

    public String getEndDateMonthDayFormat() {
        String tempStr = StringUtil.safeString(endDate);
        if (tempStr.length() >= 10) {
            tempStr = tempStr.substring(6);
        }
        return tempStr;
    }
}
